<!--
 * @Author: suo.tianbao suo.tianbao@vpclub.cn
 * @Date: 2023-10-11
 * @LastEditors: suo.tianbao suo.tianbao@vpclub.cn
 * @LastEditTime: 2023-10-11
 * @FilePath: /element-admin/src/views/aliyun/VpProduct.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div id="purn-ever-green-wealth-income-page">
    <!--顶部搜索栏-->
    <div class="col-md-12">
      <el-row :gutter="20">
        <el-col :span="20" :offset="1" class="clearfix">
          <el-card class="box-card">
            <template #header>
              <div class="card-header">
                <span style="font-size: 22px;">A.常青财富收入参数 </span>
                <el-button type="primary" class="button" @click="handle_init" size="small">核查参数</el-button>
              </div>
            </template>
            <el-form :model="EGI" label-width="140px">
              <el-row :gutter="10">
                <el-col :sm="14" :xs="14" :md="14" :lg="14" :xl="14">
                  <el-form-item label="数据验证key">
                    <el-input v-model="key" readonly></el-input>
                  </el-form-item>
                </el-col>
                <el-col :sm="10" :xs="10" :md="10" :lg="10" :xl="10">
                  <el-form-item label="验证结果">
                    <span>{{ hit_msg }}</span>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-divider content-position="left">基本设置参数</el-divider>
              <el-row :gutter="10">
                <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8">
                  <el-form-item label="次年歲">
                    <el-input v-model="EGI.select_anb" placeholder="次年歲" size="small" :clearable="true" maxlength="3"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8">
                  <el-form-item label="IRR 翌年歲">
                    <el-input v-model="EGI.irr_anb" placeholder="IRR 翌年歲" size="small" :clearable="true" maxlength="3"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8">
                  <el-form-item label="计算年期">
                    <el-input v-model="EGI.year" placeholder="计算年期" size="small" :clearable="true" maxlength="3"></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row :gutter="10">
                <el-col :sm="12" :xs="12" :md="12" :lg="12" :xl="12">
                  <el-form-item label="使用貨幣">
                    <el-input v-model="EGI.currency" placeholder="使用貨幣" size="small" :clearable="true" v-show="false"></el-input>
                    <el-radio-group v-model="EGI.currency">
                      <el-radio :label="opt.value" :title="opt.label" v-for="opt in currency_options" v-bind:key="opt.key"></el-radio>
                    </el-radio-group>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row :gutter="10">

                <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8">
                  <el-form-item label="現金提取 IRR">
                    <el-input v-model="EGI.cash_payment_irr" placeholder="現金提取 IRR" size="small" :clearable="true" maxlength="3"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8">
                  <el-form-item label="積存 IRR">
                    <el-input v-model="EGI.accumulation_irr" placeholder="積存 IRR" size="small" :clearable="true" maxlength="3"></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row :gutter="10">
                <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8">
                  <el-form-item label="投資金額">
                    <el-input v-model="EGI.saving" placeholder="投资額" size="small" :clearable="true" maxlength="9"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8">
                  <el-form-item label="供款期">
                    <el-tooltip class="item" effect="dark" content="投入资金使用年数" placement="right">
                      <el-select v-model="EGI.select_payment" placeholder="供款期" size="small">
                        <el-option label="请选择" value=0></el-option>
                        <el-option :label="item.label" :value=item.value :data="item" v-for="item in select_payment_options"
                                   v-bind:key="item.value"></el-option>
                      </el-select>
                    </el-tooltip>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row :gutter="10">
                <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8">
                  <el-form-item label="重複投資計劃">
<!--                    <el-input v-model="EGI.repeat_saving_plan" placeholder="重複投資計劃" size="small"-->
<!--                              :clearable="true"></el-input>-->
                    <el-select v-model="EGI.repeat_saving_plan" placeholder="重複投資計劃" size="small">
                      <el-option label="请选择" value=0></el-option>
                      <el-option :label="item.label" :value=item.value :data="item" v-for="item in select_repeat_saving_plan_optionss"
                                 v-bind:key="item.value"></el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8">
                  <el-form-item label="重複投資增長率">
                    <el-tooltip class="item" effect="dark" content="放弃投资，申请退款次年岁" placement="right">
                      <el-input v-model="EGI.repeat_saving_growth_rate" placeholder="重複投資增長率" size="small"
                                :clearable="true"></el-input>
                    </el-tooltip>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row :gutter="10">
                <el-col :sm="24" :xs="24" :md="24" :lg="24" :xl="24">
                  <el-form-item label="是否加入推廣優惠">
                    <el-switch v-model="EGI.promotion"/>
                    <span style="margin-left: 15px">(tips:加入选择优惠影响次年投资额的返现金额)</span>
                  </el-form-item>
                </el-col>
              </el-row>
            </el-form>
          </el-card>
        </el-col>
      </el-row>
    </div>
    <!--中部数据表格栏-->
    <div class="col-md-12" style="margin-top: 25px">
      <el-row :gutter="20">
        <el-col :span="22" :offset="1" class="clearfix">
          <el-card class="box-card" style="margin-bottom: 15px">
            <template #header>
              <div class="card-header">
                <span style="font-size: 22px;">B.常青财富收益产品投资核算 </span>
                <el-button type="info" class="button" @click.native="handleDisplayChoose" size="small">选择展示内容</el-button>
              </div>
            </template>
            <div>
              <div style="margin-bottom: 15px"><span>結算貨幣:</span><span style="margin-left: 15px">{{ EGI.currency }}</span></div>
              <el-table :header-cell-style="{background: '#eef1f6', color:'#606266'}"
                        :data="tableData" :cell-style="{padding:'3px'}" :row-style="{height:'30px'}" :max-height="tableHeight"
                        :key="isIndex" style="width: 100%" v-loading="isLoading" border stripe row-key="id">
                <el-table-column fixed type="index" label="序号" width="65px" v-if="false"></el-table-column>
                <el-table-column fixed prop="Year_res" label="年期" width="65px"/>
                <el-table-column fixed prop="ANB_res" label="次年歲" width="65px"/>
                <el-table-column fixed prop="one_Annual_Contribution_res" v-bind:label="'每年供款'"/>
                <el-table-column label="現金提取">
                <el-table-column fixed prop="one_Cash_Payment_Income_res" v-bind:label="'入息'"/>
                <el-table-column fixed prop="one_Cash_Payment_Cumulative_Income_res" v-bind:label="'累積入息'"/>
                <el-table-column fixed prop="one_Cash_Payment_Surrender_Value_res" v-bind:label="'退保價值'"/>
                </el-table-column>
                <el-table-column label="積存">
                <el-table-column fixed prop="one_Accumulation_Income_res" v-bind:label="'入息'"/>
                <el-table-column fixed prop="one_Accumulation_Balance_res" v-bind:label="'積存結餘'"/>
                <el-table-column fixed prop="one_Accumulation_Surrender_Value_res" v-bind:label="'退保價值'"/>
                </el-table-column>
                <el-table-column prop="one_Contribution_res" label="Contribution_res" v-if="checkColumnShow('Contribution_res')"/>
                <el-table-column prop="one_G_m_income_res" label="G_m_income_res" v-if="checkColumnShow('G_m_income_res')"/>
                <el-table-column prop="one_nG_m_income_res" label="nG_m_income_res" v-if="checkColumnShow('nG_m_income_res')"/>
                <el-table-column prop="one_G_CV_res" label="G_CV_res" v-if="checkColumnShow('G_CV_res')"/>
                <el-table-column prop="one_Terminal_res" label="Terminal_res" v-if="checkColumnShow('Terminal_res')"/>
                <el-table-column prop="one_G_acc_res" label="G_acc_res" v-if="checkColumnShow('G_acc_res')"/>
                <el-table-column prop="one_nG_acc_res" label="nG_acc_res" v-if="checkColumnShow('nG_acc_res')"/>
                <el-table-column prop="one_Contribution_1_res" label="Contribution_1_res" v-if="checkColumnShow('Contribution_1_res')"/>
                <el-table-column prop="one_G_m_income_1_res" label="G_m_income_1_res" v-if="checkColumnShow('G_m_income_1_res')"/>
                <el-table-column prop="one_nG_m_income_1_res" label="nG_m_income_1_res" v-if="checkColumnShow('nG_m_income_1_res')"/>
                <el-table-column prop="one_G_CV_1_res" label="G_CV_1_res" v-if="checkColumnShow('G_CV_1_res')"/>
                <el-table-column prop="one_Terminal_1_res" label="Terminal_1_res" v-if="checkColumnShow('Terminal_1_res')"/>
                <el-table-column prop="one_G_acc_1_res" label="G_acc_1_res" v-if="checkColumnShow('G_acc_1_res')"/>
                <el-table-column prop="one_nG_acc_1_res" label="nG_acc_1_res" v-if="checkColumnShow('nG_acc_1_res')"/>
                <el-table-column prop="one_Contribution_2_res" label="Contribution_2_res" v-if="checkColumnShow('Contribution_2_res')"/>
                <el-table-column prop="one_G_m_income_2_res" label="G_m_income_2_res" v-if="checkColumnShow('G_m_income_2_res')"/>
                <el-table-column prop="one_nG_m_income_2_res" label="nG_m_income_2_res" v-if="checkColumnShow('nG_m_income_2_res')"/>
                <el-table-column prop="one_G_CV_2_res" label="G_CV_2_res" v-if="checkColumnShow('G_CV_2_res')"/>
                <el-table-column prop="one_Terminal_2_res" label="Terminal_2_res" v-if="checkColumnShow('Terminal_2_res')"/>
                <el-table-column prop="one_G_acc_2_res" label="G_acc_2_res" v-if="checkColumnShow('G_acc_2_res')"/>
                <el-table-column prop="one_nG_acc_2_res" label="nG_acc_2_res" v-if="checkColumnShow('nG_acc_2_res')"/>
                <el-table-column prop="one_Contribution_3_res" label="Contribution_3_res" v-if="checkColumnShow('Contribution_3_res')"/>
                <el-table-column prop="one_G_m_income_3_res" label="G_m_income_3_res" v-if="checkColumnShow('G_m_income_3_res')"/>
                <el-table-column prop="one_nG_m_income_3_res" label="nG_m_income_3_res" v-if="checkColumnShow('nG_m_income_3_res')"/>
                <el-table-column prop="one_G_CV_3_res" label="G_CV_3_res" v-if="checkColumnShow('G_CV_3_res')"/>
                <el-table-column prop="one_Terminal_3_res" label="Terminal_3_res" v-if="checkColumnShow('Terminal_3_res')"/>
                <el-table-column prop="one_G_acc_3_res" label="G_acc_3_res" v-if="checkColumnShow('G_acc_3_res')"/>
                <el-table-column prop="one_nG_acc_3_res" label="nG_acc_3_res" v-if="checkColumnShow('nG_acc_3_res')"/>
                <el-table-column prop="one_Contribution_4_res" label="Contribution_4_res" v-if="checkColumnShow('Contribution_4_res')"/>
                <el-table-column prop="one_G_m_income_4_res" label="G_m_income_4_res" v-if="checkColumnShow('G_m_income_4_res')"/>
                <el-table-column prop="one_nG_m_income_4_res" label="nG_m_income_4_res" v-if="checkColumnShow('nG_m_income_4_res')"/>
                <el-table-column prop="one_G_CV_4_res" label="G_CV_4_res" v-if="checkColumnShow('G_CV_4_res')"/>
                <el-table-column prop="one_Terminal_4_res" label="Terminal_4_res" v-if="checkColumnShow('Terminal_4_res')"/>
                <el-table-column prop="one_G_acc_4_res" label="G_acc_4_res" v-if="checkColumnShow('G_acc_4_res')"/>
                <el-table-column prop="one_nG_acc_4_res" label="nG_acc_4_res" v-if="checkColumnShow('nG_acc_4_res')"/>
                <el-table-column prop="one_Contribution_5_res" label="Contribution_5_res" v-if="checkColumnShow('Contribution_5_res')"/>
                <el-table-column prop="one_G_m_income_5_res" label="G_m_income_5_res" v-if="checkColumnShow('G_m_income_5_res')"/>
                <el-table-column prop="one_nG_m_income_5_res" label="nG_m_income_5_res" v-if="checkColumnShow('nG_m_income_5_res')"/>
                <el-table-column prop="one_G_CV_5_res" label="G_CV_5_res" v-if="checkColumnShow('G_CV_5_res')"/>
                <el-table-column prop="one_Terminal_5_res" label="Terminal_5_res" v-if="checkColumnShow('Terminal_5_res')"/>
                <el-table-column prop="one_G_acc_5_res" label="G_acc_5_res" v-if="checkColumnShow('G_acc_5_res')"/>
                <el-table-column prop="one_nG_acc_5_res" label="nG_acc_5_res" v-if="checkColumnShow('nG_acc_5_res')"/>

              </el-table>
            </div>
          </el-card>
        </el-col>
      </el-row>
    </div>
    <el-dialog title="展示数据列" :visible.sync="dialogVisible" width="75%" :before-close="handleClose">
      <el-card class="box-card" style="margin-bottom: 15px">
        <template #header>
          <div class="card-header">
            <span style="font-size: 22px;">展示数据列 </span>
            <el-button type="info" class="button" @click.native="handleResetChoose" size="small">一键恢复</el-button>
          </div>
        </template>
        <div>
          <el-form :inline="true" :model="query">
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.Contribution_res" active-text="Contribution_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.G_m_income_res" active-text="G_m_income_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.nG_m_income_res" active-text="nG_m_income_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.G_CV_res" active-text="G_CV_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.Terminal_res" active-text="Terminal_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.G_acc_res" active-text="G_acc_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.nG_acc_res" active-text="nG_acc_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.Contribution_1_res" active-text="Contribution_1_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.G_m_income_1_res" active-text="G_m_income_1_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.nG_m_income_1_res" active-text="nG_m_income_1_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.G_CV_1_res" active-text="G_CV_1_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.Terminal_1_res" active-text="Terminal_1_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.G_acc_1_res" active-text="G_acc_1_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.nG_acc_1_res" active-text="nG_acc_1_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.Contribution_2_res" active-text="Contribution_2_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.G_m_income_2_res" active-text="G_m_income_2_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.nG_m_income_2_res" active-text="nG_m_income_2_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.G_CV_2_res" active-text="G_CV_2_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.Terminal_2_res" active-text="Terminal_2_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.G_acc_2_res" active-text="G_acc_2_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.nG_acc_2_res" active-text="nG_acc_2_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.Contribution_3_res" active-text="Contribution_3_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.G_m_income_3_res" active-text="G_m_income_3_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.nG_m_income_3_res" active-text="nG_m_income_3_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.G_CV_3_res" active-text="G_CV_3_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.Terminal_3_res" active-text="Terminal_3_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.G_acc_3_res" active-text="G_acc_3_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.nG_acc_3_res" active-text="nG_acc_3_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.Contribution_4_res" active-text="Contribution_4_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.G_m_income_4_res" active-text="G_m_income_4_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.nG_m_income_4_res" active-text="nG_m_income_4_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.G_CV_4_res" active-text="G_CV_4_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.Terminal_4_res" active-text="Terminal_4_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.G_acc_4_res" active-text="G_acc_4_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.nG_acc_4_res" active-text="nG_acc_4_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.Contribution_5_res" active-text="Contribution_5_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.G_m_income_5_res" active-text="G_m_income_5_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.nG_m_income_5_res" active-text="nG_m_income_5_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.G_CV_5_res" active-text="G_CV_5_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.Terminal_5_res" active-text="Terminal_5_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.G_acc_5_res" active-text="G_acc_5_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
            <el-col :sm="8" :xs="8" :md="8" :lg="8" :xl="8"><el-form-item><el-switch v-model="extra_column.nG_acc_5_res" active-text="nG_acc_5_res" inactive-text="off" size="small" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"/></el-form-item></el-col>
          </el-form>
        </div>
      </el-card>
    </el-dialog>
  </div>
</template>
<script>
import {mapMutations} from "vuex";
import {initBaseStdTab, initParam} from "@/api/PurmEGIApi";

export default {
  name: "PurmEvergreenWealthIncomeView",
  components: {},
  data() {
    return {
      isIndex: 1,
      isLoading: false,
      dialogVisible: false,
      key: '',
      hit_msg: '',
      tableHeight: 650,
      EGI: {
        year: 10,
        select_payment: 1,
        select_anb: 7,
        irr_anb: 91,
        currency: "HKD",
        cash_payment_irr: parseFloat(5 / 100),
        accumulation_irr: parseFloat(4.6 / 100),
        saving: 1000000,
        repeat_saving_plan: 5,
        repeat_saving_growth_rate: 0,
        promotion: true
      },
      loops: [1,2,3,4,5],
      tableData: [{
        chgtab_Year_res: 0,
        chgtab_ANB_res: 0,
        chgtab_Annual_Contribution_res: 0,
        chgtab_Extra_Withdrawal_res: 0,
        chgtab_Total_Withdrawal_res: 0,
        chgtab_Cumulative_Withdrawal_res: 0,
        chgtab_Balance_res: 0,
        chgtab_Death_Benefit_res: 0,
        Cashflow_res: 0,
      }],
      select_payment_options: [
        {label: "1", value: 1, key: 1},
        {label: "10", value: 10, key: 10},
        {label: "20", value: 20, key: 20},
        {label: "30", value: 30, key: 30}
      ],
      select_repeat_saving_plan_optionss: [
        {label: "0", value: 0, key: 0},
        {label: "1", value: 1, key: 1},
        {label: "2", value: 2, key: 2},
        {label: "3", value: 3, key: 3},
        {label: "4", value: 4, key: 4},
        {label: "5", value: 5, key: 5},
      ],
      currency_options: [
        {label: "USD", value: "USD", key: "USD"},
        {label: "HKD", value: "HKD", key: "HKD"},
        {label: "RMB", value: "RMB", key: "RMB"}
      ],
      promotion_options: [
        {label: "Y", value: "Y", key: "Y"},
        {label: "N", value: "N", key: "N"}
      ],
      query: {
        strPram: '',
        year: 0,
      },
      input_Extra_Withdrawal: [],
      extra_column: {
        Contribution_res	:0,
        G_m_income_res	:0,
        nG_m_income_res	:0,
        G_CV_res	:0,
        Terminal_res	:0,
        G_acc_res	:0,
        nG_acc_res	:0,
        Contribution_1_res	:0,
        G_m_income_1_res	:0,
        nG_m_income_1_res	:0,
        G_CV_1_res	:0,
        Terminal_1_res	:0,
        G_acc_1_res	:0,
        nG_acc_1_res	:0,
        Contribution_2_res	:0,
        G_m_income_2_res	:0,
        nG_m_income_2_res	:0,
        G_CV_2_res	:0,
        Terminal_2_res	:0,
        G_acc_2_res	:0,
        nG_acc_2_res	:0,
        Contribution_3_res	:0,
        G_m_income_3_res	:0,
        nG_m_income_3_res	:0,
        G_CV_3_res	:0,
        Terminal_3_res	:0,
        G_acc_3_res	:0,
        nG_acc_3_res	:0,
        Contribution_4_res	:0,
        G_m_income_4_res	:0,
        nG_m_income_4_res	:0,
        G_CV_4_res	:0,
        Terminal_4_res	:0,
        G_acc_4_res	:0,
        nG_acc_4_res	:0,
        Contribution_5_res	:0,
        G_m_income_5_res	:0,
        nG_m_income_5_res	:0,
        G_CV_5_res	:0,
        Terminal_5_res	:0,
        G_acc_5_res	:0,
        nG_acc_5_res	:0,
      }
    }
  },
  computed: {},
  methods: {
    ...mapMutations(['add_tab']),
    handleFetch() {
      this.isLoading = true;
      this.handle_init();
    },
    handle_init() {
      this.tableData = [];
      initParam(this.EGI).then(res => {
        let _res = eval(res.data);
        this.key = _res.key;
        this.hit_msg = _res.res_msg;
        // 发起参数核算
        this.query.strPram = _res.key;
        this.query.year = this.EGI.year;
        this.isLoading = true;
        initBaseStdTab(this.query).then(res => {
          if (res.code == 200) {
            this.isLoading = false;
            this.tableData = res.data;
            // Message.success("参数核算完成")
            this.$notify({
              title: '执行成功',
              message: '参数核算完成',
              type: 'success',
              offset: 100
            });
          }
        }).catch(err => {
          // Message.error('错了哦，STEP 2 参数核算异常' + err);
          this.$notify({
            title: '执行失败',
            message: '系统异常，执行 STEP 2 初始化年化产品投资核算异常' + err,
            type: 'error',
            offset: 100
          });
        })
      }).catch(err => {
        // Message.error('系统异常，STEP 1 参数异常' + err);
        this.$notify({
          title: '执行失败',
          message: '系统异常，执行 STEP 1 投资参数解析异常' + err,
          type: 'error',
          offset: 100
        });
      })
      this.input_Extra_Withdrawal = [];
    },
    handleDisplayChoose() {
      this.dialogVisible = true;
    },
    handleResetChoose(){
      this.extra_column = this.initExtra_col();
    },
    handleClose() {
      this.dialogVisible = false;
    },
    checkColumnShow(check_key) {
      return this.extra_column[check_key] == 1
    },
  },
  created() {
    // this.handle_init();
  },
  mounted() {
  },
}
</script>
<style scoped>
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.custRow {
  display: flex;
  margin-top: 5px;
  padding: 5px 5px 5px 5px;
}
</style>